home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MENU_UTL / DESIGN / DESIGN5.DOC < prev    next >
Text File  |  1989-01-04  |  28KB  |  614 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.                      ╔══════════════════════════════════╗
  13.                      ║          DURA DESIGN             ║
  14.                      ║                                  ║
  15.                      ║          DESIGN5.EXE             ║
  16.                      ║                                  ║
  17.                      ║  INTELLIGENT DATABASE DESIGNER   ║
  18.                      ║                                  ║
  19.                      ║     (C) Jerry Adkins 1988        ║
  20.                      ║                                  ║
  21.                      ╚══════════════════════════════════╝
  22.  
  23.                   RELEASE 5.0, January, 1989
  24.  
  25.  
  26.  
  27.  
  28.           Design program and documentation Copyright (C), 1989
  29.           7770 Regents Road
  30.           Suite 113-226
  31.           San Diego, CA 92122
  32.  
  33.           Registered users will receive a diskette with the latest version
  34.           of Dura Design. The disk will also contain the following programs:
  35.  
  36.           DURA MENU  Hard drive menu control system, with optional virus
  37.           protection, and encrypted password. This program is currently the
  38.           standard menu system in nine Ford car plants.
  39.  
  40.           FKEYS      Program function keys to execute several commands at
  41.                      DOS level.
  42.  
  43. ----------------------------------------------------------------------------
  44.  
  45.    I wish to register Dura Design, and receive the update diskette that also
  46.    includes Dura Menu and FKEYS. Included is the $20 registration fee.
  47.  
  48.  
  49.    Name: _____________________________________________
  50.  
  51.  
  52.    Street: ___________________________________________
  53.  
  54.  
  55.    City: ________________________ State: ___________ Zip: ___________
  56.  
  57.  
  58.  
  59. ----------------------------------------------------------------------------
  60.  
  61.           You may freely distribute copies of this disk to others, provided
  62.           the files are not altered, or sold.
  63.  
  64.           Due to the many variations of programs created by this product,
  65.           J. Adkins or Adkins Enterprises will not assume any liability
  66.           for the use of this product, or the suitability for any particular
  67.           machine.
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.                                Table Of Contents
  80.                                -----------------
  81.  
  82.           Introduction........................................D-1
  83.  
  84.           Mew Features........................................D-2
  85.  
  86.           Defining And Generating Your Program................D-3
  87.  
  88.           Editing A Defined Program...........................D-4
  89.  
  90.           How To Use The Generated Program....................D-5
  91.  
  92.           Format Of Design Disk Files.........................D-6
  93.  
  94.           Limited License For Design..........................D-7
  95.  
  96.           D-1)                   Introduction
  97.                                   ------------
  98.  
  99.           At Adkins Enterprises, we do quite a lot of database work, both for
  100.           ourselves and for clients.  After writing about the one millionth
  101.           database manager, we came to a startling conclusion: very little
  102.           was actually changing from program to program.  We became good at
  103.           reinventing the wheel, but this time a thought struck us, "Why not
  104.           write a database program generator?" Design is the end result.
  105.           Basically what it does is allow you to set up your unique database
  106.           needs, and then actually writes a dedicated database program in
  107.           Pascal while you watch.
  108.  
  109.           What we found was that we were doing in a few minutes what used to
  110.           take days or weeks. Here's a brief outline of Design's capabilities
  111.           and features:
  112.  
  113.           1) This program allows you to set up a customized data entry system
  114.              and then writes a dedicated Pascal database manager program.
  115.  
  116.           2) Several different types of input fields are supported: Numeric,
  117.              Alphanumeric, Calculated, etc. Strict type checking is done on
  118.              the input.
  119.  
  120.           3) The generated program is documented with remarks for easy
  121.              customization.
  122.  
  123.           4) Typical record access (no matter how many records in the system)
  124.              when the key field is known is under 1/2 second.
  125.  
  126.           5) Knowledge of Pascal, data-file input/output routines, or other
  127.              special functions is not required.  A small amount of Pascal
  128.              formula format is helpful for using formula fields.
  129.  
  130.           6) Number of fields can be as many as 50.
  131.  
  132.  
  133.  
  134.           D-2)           New features in 5.0
  135.                          -------------------
  136.  
  137.           Version 5.0 no longer requires toolbox sort modules. There is
  138.           nothing else to buy. This version takes advantage of the unit
  139.           structure of Turbo Pascal 5.0. Fewer support files are needed.
  140.           The archive file is over 30k smaller.
  141.  
  142.           Advanced error protection is incorporated into your programs.
  143.           This takes advantage of the Custom Exit procedures available to
  144.           the latest Turbo Pascal.
  145.  
  146.           All programs generated are designed to be compiled with Turbo
  147.           Pascal 5.0.
  148.  
  149.           Field input now has word processor type editing features, with
  150.           insert, delete, etc. The commands are Wordstar (tm) compatible.
  151.           This field input is incorportated into your programs, as well as
  152.           the designer program.
  153.  
  154.           A windows unit (WINDOWS.TPU) is provided, which can be incorporated
  155.           into other programs. It features removable windows.
  156.  
  157.           VAR files created by the older version can still be used to create
  158.           a newer version program. If you do this, delete the COM version of
  159.           your previous program. Turbo Pascal 5 creates EXE files.
  160.  
  161.  
  162.           D-3)           Defining And Generating Your Database
  163.                          -------------------------------------
  164.  
  165.           Before executing the Design program generator, you should insure
  166.           that the following files are on the diskette in your logged
  167.           (default) disk drive:
  168.  
  169.           1) Design program generator (DESIGN5.EXE)
  170.           2) Design library files     (IBMLIB1.INC)
  171.                                       (IBMLIB2.INC)
  172.                                       (WINDOWS.TPU)
  173.                                       (DSORT.TPU)
  174.  
  175.           5) Turbo Pascal 5.0 (tm) compiler.  (TURBO.EXE or TPC.EXE).
  176.  
  177.  
  178.           From the DOS prompt, type: DESIGN5
  179.           and the program should load and execute after a few seconds.  You
  180.           will first be presented with the screen:
  181.  
  182.                          DESIGN5.EXE
  183.                (C)COPYRIGHT ADKINS ENTERPRISES 1989
  184.                  7770 Regents Road Suite 113-226
  185.                       San Diego, CA 92122
  186.  
  187.                   ┌─────────────────────────────┐
  188.                   │  PROGRAM NAME: ■■■■■■■.PAS  │
  189.                   └─────────────────────────────┘
  190.  
  191.           The program will ask you for a filename for the resulting
  192.           program (7 characters, first character alphabetic). The eighth
  193.           character is reserved to name the sort program.
  194.  
  195.           Now it is time to designate the record fields , variable names,
  196.           and variable types. A fair amount of error checking is done to
  197.           insure you only use legal Pascal variable names, but it is best
  198.           to avoid using illegal Pascal variables.
  199.  
  200.                                                          ╒════════════════════╕
  201.                    ╒══════════════════════════════════╕  │  1    : string1;   │                   │                                  │  │  2    : string2;   │
  202.                    │ Which type for this variable?    │  │  3    : string3;   │
  203.                    │                                  │  │  4    : string4;   │
  204.                    │                                  │  │  5    : string5;   │
  205.                    ╘══════════════════════════════════╛  │  6    : string6;   │
  206.                                                          │  7    : string10;  │
  207.                                                          │  8    : string12;  │
  208.                   ┌─────────────────────────────┐        │  9    : string15;  │
  209.                   │  PROGRAM NAME: TEST■■■.PAS  │        │ 10    : string20;  │
  210.                   └─────────────────────────────┘        │ 11    : string25;  │
  211.                                                          │ 12    : string30;  │
  212.                                                          │ 13    : string40;  │
  213.                                                          │ 14    : string50;  │
  214.                                                          │ 15    : string60;  │
  215. Used =   1. Avail =  49. Variable name = first_name      │ 16    : string65;  │
  216.                                                          │ 17    : string75;  │
  217.                                                          │ 18    : string80;  │
  218.                                                          │ 19    : integer;   │
  219.                                                          │ 20    : real;      │
  220.                                                          │                    │
  221.                                                          │                    │
  222.                                                          ╘════════════════════╛
  223.  
  224.  
  225.  
  226.           First, a little background on database files.  A database file
  227.           consists of a group of individual entries called "records".  A record
  228.           might be a recipe, information on an employee, or an address book
  229.           listing.  Each record is further subdivided into groups of
  230.           information called "fields".  In an employee record, one field might
  231.           contain the date the employee was hired, and another might have his
  232.           zip code.  One of the fields in each record is predefined as the "key
  233.           field".  This is the field that best identifies each record, and will
  234.           be used to retrieve the record from the file.  If a file contained
  235.           records of inventory parts, you might designate the inventory number
  236.           as the key field.  In an address list, you might use the person's
  237.           last name as a key field.
  238.  
  239.           Why the last name instead of the full name?  Design works best in
  240.           applications where you know the key field.  It's easy to forget
  241.           whether you entered a person as John Smith or J. G. Smith, so the
  242.           last name system would work best.  If you're not sure of the key
  243.           field exactly, there is a mechanism for still finding the record, but
  244.           it is much slower. Better yet, use a key identifier that makes each
  245.           particular record unique, such as a social security number.
  246.  
  247.           Back to the program.
  248.  
  249.                                  ADDRESS BOOK
  250. Move cursor to location for first_name prompt and press ENTER
  251.  
  252.  ─────────────────────────────────────────────────────────────────────────────
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                       █
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  ─────────────────────────────────────────────────────────────────────────────
  274.           The above prompt will be repeated until you have positioned all
  275.           the field prompts and input locations on the screen.
  276.  
  277.           At the top of the screen, a new message appears telling you to
  278.           enter the field prompt you wish to use.  Type in a descriptive
  279.           message that will prompt the user to type in the correct information
  280.           for that field (like NAME: or PART NUMBER:, for instance).  You have
  281.           up to 40 characters for the field prompt, and you can leave it blank
  282.           should you wish.  The program will again ask you to position the
  283.           cursor and press Enter.  Don't worry about moving the cursor
  284.           over other characters on the screen, it's doesn't destroy what it
  285.           moves over.  Don't allow your information to overlap other fields,
  286.           though.
  287.  
  288.           The following is a typical screen after all the variables have
  289.           been defined. Now a sort key may be selected. Any of the fields
  290.           can be used for a sort key, even numeric ones. In this case, we
  291.           are using 7, the social security number. The sort key is the
  292.           same as the key field.
  293.  
  294. ╒═════════════════════════════════════════════════════════════════════════════╕
  295. │   1 fname : string15;                                                       │
  296. │   2 lname : string15;                                                       │
  297. │   3 street : string25;                                                      │
  298. │   4 city : string25;                                                        │
  299. │   5 state : string2;                                                        │
  300. │   6 zip : string10;                                                         │
  301. │   7 social_security : string10;                                             │
  302. │   8 amt_owed : real;                                                        │
  303. │                                                                             │
  304. │ Sort key # 7                                                                │
  305. │                                                                             │
  306. │                                                                             │
  307. │                                                                             │
  308. │                                                                             │
  309. │                                                                             │
  310. │                                                                             │
  311. │                                                                             │
  312. │                                                                             │
  313. │                                                                             │
  314. │                                                                             │
  315. │                                                                             │
  316. │                                                                             │
  317. ╘═════════════════════════════════════════════════════════════════════════════╛
  318.  
  319.  
  320.  
  321.                                  CUSTOMER DATA
  322. Formula =  'AMT DUE: ',(amt_owed / 12)
  323.  
  324.  ─────────────────────────────────────────────────────────────────────────────
  325.  
  326.             FIRST NAME:
  327.  
  328.              LAST NAME:
  329.  
  330.                 STREET:
  331.  
  332.                   CITY:
  333.  
  334.                  STATE:
  335.  
  336.                    ZIP:
  337.  
  338.        SOCIAL SECURITY:
  339.  
  340.               AMT OWED $è
  341.  
  342.  
  343.  ─────────────────────────────────────────────────────────────────────────────
  344.  
  345.          D-4)               EDITING A DEFINED PROGRAM
  346.                             -------------------------
  347.           You didn't think I would leave you hanging without a way to change
  348.           an already generated program did you?
  349.  
  350.           For each program generated, there is a small token VAR file. The
  351.           only thing you need to reconstruct your program is this file. A
  352.           typical file size is about 1k bytes. This means you could store
  353.           several dozen programs on a single floppy diskette. A typical
  354.           CUST.PAS program would also have a CUST.VAR file generated.
  355.           When Design asks for a filename in the opening screen, just type
  356.           in the name of the program you want to change.
  357.  
  358.  
  359.                          DESIGN5.EXE
  360.                (C)COPYRIGHT ADKINS ENTERPRISES 1989
  361.                   7770 Regents Road Suite 113-226
  362.                       San Diego, CA 92122
  363.  
  364.                   ┌─────────────────────────────┐
  365.                   │  PROGRAM NAME: CUST■■■.PAS  │
  366.                   └─────────────────────────────┘
  367.  
  368.  
  369.              Will CUST be a new program? (Y/N) N
  370.  
  371.  
  372.  
  373.          <A>dd   <D>elete   <C>hange   <I>nsert   <Q>uit  (A/D/C/I/Q) A
  374.  
  375. Used =   7. Avail =  43. Variable name =
  376.  
  377.  
  378.  
  379.           After the editing is complete, a new VAR file is also created.
  380.           Now, let's suppose you have already keyed in a lot of data into
  381.           your database. It's no longer compatible with the new program.
  382.           Don't worry. Design will optionally create a data convert program
  383.           CONV.PAS. How's that for service? When you run CONV.PAS, it will
  384.           convert the old database over to the newer format. If you didn't
  385.           have a lot of time in the data, you may want to just delete the
  386.           data file. Your generated program will create it again first time
  387.           run.
  388.  
  389.           Warning! Always delete CONV.PAS after it is used. Running it more
  390.           than one time would damage the new database. Of course you DID
  391.           have a backup copy of your data didn't you? Well, DIDN'T YOU???
  392.  
  393.  
  394.           TIPS FOR MAKING DESIGN A PLEASANT EXPERIENCE:
  395.           ---------------------------------------------
  396.           1) Although the use of a hard drive is not mandatory, it will make
  397.              life a lot easier.
  398.           2) You can't go back until later if you make an error during
  399.              definition, so move slowly and have some sense of direction.
  400.              freestyle coding can be fast, but you're better off at least
  401.              having a rough sketch of what you'd like to end up with before
  402.              starting.  This goes double if you intend to use formulas.
  403.  
  404.  
  405.           D-5)              How To Use The Generated Program
  406.                              --------------------------------
  407.               The following is an example menu showing the options of your
  408.               generated program. All your programs will use this menu. Your
  409.               program will have actual removable windows that are almost
  410.               instantly displayed and removed during the operation of the
  411.               program. Don't confuse this section with the instructions for
  412.               running the Design program.
  413.  
  414.               In the right window, there are three options. These options
  415.               are selected by pressing the up/down arrow keys and pressing
  416.               enter when the option is highlighted.
  417.  
  418.  
  419.                                               01/04/89. - 05:34:05 PM
  420.  
  421.       CUSTOMER DATABASE
  422.       3112960 bytes free
  423.  
  424.           ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  425.           ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  426.           ░░░░░╒═════════════════════╕░░╒═════════════════════╕░░░░░░░
  427.           ░░░░░│  F1: Help           │░░│                     │░░░░░░░
  428.           ░░░░░│  F2: Printer setup  │░░│ >EDIT RECORD        │░░░░░░░
  429.           ░░░░░│  F3: Colors         │░░│  ADD RECORD         │░░░░░░░
  430.           ░░░░░│  F4: Clock On/Off   │░░│  REPORT             │░░░░░░░
  431.           ░░░░░│  F5: Sort           │░░│                     │░░░░░░░
  432.           ░░░░░│  F6: Shrink         │░░│                     │░░░░░░░
  433.           ░░░░░│  F7: Backup Data    │░░│                     │░░░░░░░
  434.           ░░░░░│  ESC-Exit           │░░│                     │░░░░░░░
  435.           ░░░░░╘═════════════════════╛░░╘═════════════════════╛░░░░░░░
  436.           ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  437.           ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  438.  
  439.               EDIT RECORD
  440.               -----------
  441.               Allows changing any or all fields within a record. Within the
  442.               edit screen, there are several sub-commands that allow you to
  443.               change data, delete the entire record, move forward/backward
  444.               through the database. Use the edit option when you want to
  445.               navigate through the database to find and change things.
  446.  
  447.               SUB-OPTIONS FOR EDIT RECORD
  448.               ---------------------------
  449.               +   Move forward one record.
  450.               -   Move back one record.
  451.               B   Move to beginning of file (first record).
  452.               C   Change a record.
  453.               D   Delete current record.
  454.               E   Move to end of file (last record).              F   Find a record by search key.
  455.  
  456.               If the change option is selected, you can press enter for the
  457.               fields you want to keep, or overtype the ones you want to
  458.               change. You can move back one field by pressing the up-arrow
  459.               key.
  460.  
  461.               ADD RECORD
  462.               ----------
  463.               Displays the edit/add screen and allows you to key in the
  464.               information for a new record. You can move forward/backward
  465.               through the fields with the up/down arrow keys.
  466.  
  467.               REPORT
  468.               ------
  469.               A screen similar to the edit/change screen is displayed. This
  470.               allows you to pick out certain fields for printing. For
  471.               instance, if you wanted to print all records for people who
  472.               live in California, and ignore all others, you would press
  473.               enter for all fields except the state filed, and then type
  474.               CA for the state.
  475.  
  476.               Using this technique makes it possible to make various
  477.               combinations of printed reports, by keying in partial
  478.               fields we could do something like print all records that
  479.               have people in the 9 zip area who have last names beginning
  480.               with S.
  481.  
  482.               LEFT WINDOW FUNCTION KEY COMMANDS
  483.               ---------------------------------
  484.               F1: Help
  485.               --------
  486.               Brings up a help window. The help text can be any text file
  487.               created by you and converted by the HELPCONV.COM program.
  488.               HELPCONV is a program that converts your ASCII files over to
  489.               a record structure usable by your generated program. This
  490.               allows you to move forward/backward through the help file
  491.               with the + - keys.
  492.  
  493.               Handy tip: the calls to (procedure help) in your program can
  494.               be modified to make more efficient use of the help file. For
  495.               instance, if your help file talks about the edit screen
  496.               beginning with line 50, then change the call in the edit
  497.               procedure to "help(50)" which starts at line 50 in your help
  498.               file.
  499.  
  500.               VERY IMPORTANT: Make sure any lines in your help file to be
  501.               converted don't exceed 65 characters. This is the width of
  502.               the help window. An example file "HELP.FIL" is provided for
  503.               your use. When it is converted, the file "HELP.TXT" is
  504.               created.
  505.  
  506.               F2: Printer setup
  507.               -----------------
  508.               Allows you to configure the program for an Epson or Okidata              printer. In order to use the codes in your program, you will
  509.               need to modify (procedure print_record) a bit, otherwise the
  510.               program will use normal print. Three string variables are
  511.               used for this purpose. They will be in the CONST section of
  512.               your program. The defaults are for the Okidata printer:
  513.               The following typed constants are actually initialized
  514.               variables.
  515.  
  516.               preset : string[5] = #24;
  517.               expanded : string[5] = #31;
  518.               normal : string[5] = #30;
  519.  
  520.               You could change a line like:
  521.               writeln(lst,fname);
  522.               in the print_record procedure
  523.               to
  524.               writeln(lst,expanded,fname);   { Print first name expanded }
  525.  
  526.               F3: Colors
  527.               ----------
  528.               Sets all the foreground/background window colors. Pressing
  529.               enter for each one will use the defaults. The first time
  530.               your program is run, this option will be executed.
  531.  
  532.               F4: Clock On/Off
  533.               ----------------
  534.               Toggles the ticking clock on/off. If the clock annoys you,
  535.               you can turn it off. The default is on, but you can change
  536.               that by changing the line in the main program:
  537.               Change
  538.               clockon := true;
  539.               to
  540.               clockon := false;
  541.  
  542.               F5: Sort
  543.               --------
  544.               Executes the sort program that was also created by Design.
  545.               Yes, your created program has the ability to execute external
  546.               programs as well.
  547.  
  548.               In order to rapidly find a record, a binary search is employed.
  549.               If the file isn't sorted, the binary search will fail, then your
  550.               program will attempt a sequential search from the end of the
  551.               database backward. The reason for this is all new records are
  552.               appended to the end of the database until they are sorted.
  553.  
  554.               F6: Shrink
  555.               ----------
  556.               Physically removes deleted records by re-writing the database.
  557.               The database is copied record by record to a temporary file,
  558.               minus the deleted records, then the old database is deleted and
  559.               the temporary file is renamed to the normal database filename.
  560.               It is VERY important to insure that you have enough temporary
  561.               free disk space to accomplish this.
  562.               F7: Backup Data
  563.               ---------------
  564.               Copies the database to diskettes. If the database is larger than
  565.               the size of a diskette, it will pause after each diskette is
  566.               full for insertion of the next diskette.
  567.  
  568.               This option also allows you to copy the database from diskettes
  569.               to a hard drive.
  570.  
  571.               ESC-Exit
  572.               --------
  573.               Pressing the Escape key will exit the program. A window will
  574.               appear so you can verify that you really want to exit. Upon
  575.               exit, the database file is closed.
  576.  
  577.  
  578.  
  579.           D-6)     FORMAT OF THE DATABASE FILE
  580.                    ---------------------------
  581.               Since the database file is random access, it will allow read/
  582.               write anywhere in the file. The file is open all the time
  583.               during the operation of the program. No serious damage should
  584.               occur in the event of an unexpected shutdown such as a power
  585.               failure. In the event of a run time error, the file will be
  586.               closed, and an error message will appear in a window. Pressing
  587.               enter will reopen the file, and return to the program menu.
  588.  
  589.               The data file used is a file of records. Each record has a
  590.               series of fields determined by you when you run DESIGN5.EXE.
  591.  
  592.               The search routine uses a binary search, which is very fast,
  593.               but requires a database that is sorted by the key field. In
  594.               the event that the binary search fails, a sequential search
  595.               is attempted. The sequential search starts at the end of the
  596.               file and reads backward. The reason being that all new data
  597.               keyed in resides at the end of the file, and a match is more
  598.               likely to occur in this area.
  599.  
  600.               DESIGN5 was intended to create database programs that handle
  601.               only a few hundred records. If very large databases are
  602.               intended, a B-Tree type database program would probably be
  603.               better. DESIGN5 doesn't use index files. All searching is
  604.               done in the master database file. If the file is sorted,
  605.               the search is very fast, however, very large databases require
  606.               time to sort.
  607.  
  608.  
  609.           D-7)    LIMITED LICENSE FOR DESIGN
  610.                   --------------------------
  611.               Any programs generated by DESIGN5.EXE may be freely distributed
  612.               or sold for profit. DESIGN5.EXE or the source code modules for
  613.               DESIGN5.EXE may not be distributed or sold for profit.
  614.